package ex5;

import net.sf.cglib.proxy.Enhancer;

public class 代理工厂 {

    private static 代理处理器 callback = new 代理处理器();

    public static Object create(Class target){
        Enhancer enhancer = new Enhancer();
        enhancer.setCallback(callback);
        enhancer.setSuperclass(target);
        //创建代理对象
        return enhancer.create();
    }
}
